  <form name="register" action="">

    <input type="checkbox" name="hobbies[]" value="ck"  />Cricket<BR>
    <input type="checkbox" name="hobbies[]" value="hc"  />Hockey<BR>
    <input type="checkbox" name="hobbies[]" value="bd"  />Badminton<BR>
    <input type="checkbox" name="hobbies[]" value="fb"  />Football<BR>
    <input type="checkbox" name="hobbies[]" value="tn"  />Tennis<BR>

  </form>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
  <a href="javascript:void(0)" onClick="sbmt()" >click here to submit above form</a>

  <script type="text/javascript">

  function sbmt()
  {
    if(validate(document.register) == true) {
      document.register.action="http://gogole.com";
      document.register.method="post";
      document.register.submit();
    }
  }


  function validate(obj)
  {
    var hobbies = document.getElementsByName('hobbies[]');
    count = 0;
    minCheck = 2;
    //alert(hobbies.length);
    for (var i = 0; i < hobbies.length; i++)
    {
      if(hobbies[i].checked == true){
        count++;
      }
    }

    if(count < minCheck){
      alert("Please check atleast "+minCheck+" hobbies" );
      return false;
    }

    return true;
  }

  </script>
